﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JHT.SimpleTaskSystem.EntityFramework.Mapper
{
    public class PersonMapping : EntityTypeConfiguration<Person>
    {
        public PersonMapping()
        {
            ToTable("Persons");

            this.HasKey(p => p.Id);
            this.Property(p => p.Id).HasColumnName("Id").HasColumnType("int").HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity).IsRequired();
            this.Property(p => p.UserName).HasColumnName("UserName").HasColumnType("varchar").HasMaxLength(50).IsRequired();

        }
    }
}
